<?php

/**
 * GeographicRegions form base class.
 *
 * @method GeographicRegions getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseGeographicRegionsForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IGEOGRAPHIC_REGION' => new sfWidgetFormInputHidden(),
      'SREGION_NAME_ENG'   => new sfWidgetFormInputText(),
      'SREGION_NAME_THAI'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IGEOGRAPHIC_REGION' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIgeographicRegion()), 'empty_value' => $this->getObject()->getIgeographicRegion(), 'required' => false)),
      'SREGION_NAME_ENG'   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'SREGION_NAME_THAI'  => new sfValidatorString(array('max_length' => 50, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('geographic_regions[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'GeographicRegions';
  }


}
